﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.ComponentModel;
using System.Collections.ObjectModel;


namespace Url2Ringtone
{
    public class BrowserViewModel : INotifyPropertyChanged
    {
        public BrowserViewModel()
        {
            Favourites = new ObservableCollection<FavouriteItem>();
        }

        public ObservableCollection<FavouriteItem> Favourites { get; private set; }

        private bool _pageIsLoading;
        public bool PageIsLoading
        {
            get { return _pageIsLoading; }
            set
            {
                _pageIsLoading = value;
                NotifyPropertyChanged("PageIsLoading");
            }
        }

        private string _currentBrowsingUrl;
        public string CurrentBrowsingUrl
        {
            get { return _currentBrowsingUrl; }
            set
            {
                if (value != _currentBrowsingUrl)
                {
                    _currentBrowsingUrl = value;
                    NotifyPropertyChanged("CurrentBrowsingUrl");
                }
            }
        }



        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
